Skip to content

feat: support mTLS and anonymous aliases#213

Merged
overtrue merged 3 commits into
mainfrom
feat/issue-209-mtls-anonymous
May 23, 2026
Merged

feat: support mTLS and anonymous aliases#213
overtrue merged 3 commits into
mainfrom
feat/issue-209-mtls-anonymous

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented May 23, 2026

Summary

  • Add rc alias set --anonymous so aliases can be created without SigV4 credentials, and skip signing for custom XML/admin HTTP requests when anonymous mode is enabled.
  • Add --client-cert / --client-key alias options and wire the PEM client identity into the reqwest clients used for S3 XML and admin requests.
  • Surface auth_mode and mtls in alias JSON output and long human output, with validation/tests for anonymous credentials and partial client identity inputs.

Closes #209

Validation

  • cargo test -p rustfs-cli --test help_contract -- --nocapture
  • cargo test -p rustfs-cli --test error_contract -- --nocapture
  • cargo test -p rustfs-cli alias -- --nocapture
  • cargo test -p rc-s3 test_admin_client_invalid_ca_bundle_path_surfaces_error -- --nocapture
  • Attempted cargo test --workspace -j1; local macOS run was terminated with SIGTERM while running the existing client::tests::delete_bucket_cors_missing_configuration_is_successful after the earlier suites passed.

BREAKING CHANGES

This change adds new alias configuration behavior and fields for auth_mode and mtls compatibility.

Copilot AI review requested due to automatic review settings May 23, 2026 03:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds new alias capabilities to the CLI and S3/admin clients: (1) configuring aliases that intentionally perform unsigned (anonymous) requests, and (2) configuring mTLS client identity (client cert/key) for endpoints that require mutual TLS. It also updates CLI output and contract tests to surface and validate these new alias properties.

Changes:

  • Extend alias configuration to include anonymous, client_cert, and client_key, and validate these combinations in rc alias set.
  • Wire mTLS identity into the reqwest clients used by S3 XML requests and admin API requests, and skip SigV4 signing when anonymous is enabled.
  • Extend alias list output (JSON + long human output) and update CLI contract tests accordingly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/s3/src/client.rs Adds mTLS support to reqwest client construction and skips XML SigV4 signing when anonymous; updates SDK config handling and tests.
crates/s3/src/admin.rs Adds mTLS identity support for admin client and skips SigV4 signing when anonymous.
crates/core/src/config.rs Updates config test fixtures to include new alias fields.
crates/core/src/alias.rs Adds anonymous, client_cert, client_key fields to the alias model with serde defaults.
crates/cli/src/commands/alias.rs Adds --anonymous, --client-cert, --client-key flags; makes credentials positional args optional; surfaces auth/mTLS state in list output.
crates/cli/tests/help_contract.rs Updates help contract expectations for the new alias set usage/flags.
crates/cli/tests/error_contract.rs Adds contract tests for anonymous aliases and client identity validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/s3/src/client.rs Outdated
overtrue and others added 2 commits May 23, 2026 12:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: 安正超 <anzhengchao@gmail.com>
@overtrue overtrue merged commit ad1cd8e into main May 23, 2026
15 checks passed
@overtrue overtrue deleted the feat/issue-209-mtls-anonymous branch May 23, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): client certificate (mTLS) and anonymous request support

2 participants